#ifndef MEASURE_SIZE_TRACKER_GEOMETRIES_IO_H_
#define MEASURE_SIZE_TRACKER_GEOMETRIES_IO_H_

#if defined(_MSC_VER)
#pragma once
#endif

#include "geometry_elements.h"
#include <iomanip>
#include <iostream>
#include <boost/foreach.hpp>

inline std::ostream& operator<<(std::ostream& os, const vector_2& vec)
{
  os<<"("
    <<vec.vx<<", "
    <<vec.vy<<")";

  return os;
}

inline std::ostream& operator<<(std::ostream& os, const point_2& point)
{
  os<<"("
    <<point.x<<", "
    <<point.y<<")";

  return os;
}

inline std::ostream& operator<<(std::ostream& os, const box_2& box)
{
  os<<"("
    <<box.top_left<<", "
    <<box.bottom_right<<")";

  return os;
}

inline std::ostream& operator<<(std::ostream& os, const segment_2& segment)
{
  os<<"("
    <<segment.start<<", "
    <<segment.end<<")";

  return os;
}

inline std::ostream& operator<<(std::ostream& os, const angle_box_2& angle_box)
{
  os<<"("
    <<angle_box.center_x<<", "
    <<angle_box.center_y<<", "
    <<angle_box.half_width<<", "
    <<angle_box.half_height<<", "
    <<angle_box.angle<<")";

  return os;
}

inline std::ostream& operator<<(std::ostream& os, const ring_2& ring)
{
  os<<"("
    <<ring.center_x<<", "
    <<ring.center_y<<", "
    <<ring.radius<<")";

  return os;
}

inline std::ostream& operator<<(std::ostream& os, const arc_2& arc)
{
  os<<"("
    <<arc.center_x<<", "
    <<arc.center_y<<", "
    <<arc.radius<<", "
    <<arc.start_angle<<", "
    <<arc.end_angle<<")";

  return os;
}

inline std::ostream& operator<<(std::ostream& os, const annulus_2& annulus)
{
  os<<"("
    <<annulus.center_x<<", "
    <<annulus.center_y<<", "
    <<annulus.start_radius<<", "
    <<annulus.end_radius<<")";

  return os;
}

inline std::ostream& operator<<(std::ostream& os,
  const annulus_arc_2& annulus_sector)
{
  os<<"("
    <<annulus_sector.center_x<<", "
    <<annulus_sector.center_y<<", "
    <<annulus_sector.start_radius<<", "
    <<annulus_sector.end_radius<<", "
    <<annulus_sector.start_angle<<", "
    <<annulus_sector.end_angle<<")";

  return os;
}

inline std::ostream& operator<<(std::ostream& os, const polygon_2& polygon)
{
  os<<"(";
  BOOST_FOREACH(const point_2& point, polygon)
  {
    os<<point;
  }
  os<<")";

  return os;
}

#endif // MEASURE_SIZE_TRACKER_GEOMETRIES_IO_H_